import request from '@/utils/request'

export function getPersonalInfo(personalId) {
    return request({
        url: '/personal/info?personalId=' + personalId,
        method: 'get',
    })
}

export function getFollowData(currentSwitch, personalId, currentPage, pageSize) {
    return request({
        url: '/personal/follow?currentSwitch=' + currentSwitch + '&personalId=' + personalId + '&currentPage=' + currentPage + '&pageSize=' + pageSize,
        method: 'get'
    })
}

export function getLoginUserFollow(userId) {
    return request({
        url: '/personal/follow/lg?userId=' + userId,
        method: 'get'
    })
}

export function getPersonalPost(activeName, personalId, currentPage, pageSize) {
    return request({
        url: '/personal/post?activeName=' + activeName + '&personalId=' + personalId + '&currentPage=' + currentPage + '&pageSize=' + pageSize,
        method: 'get'
    })
}

export function deletePost(postId) {
    return request({
        url: '/personal/post/delete?postId=' + postId,
        method: 'delete'
    })
}

export function getTagsData() {
    return request({
        url: '/personal/interest',
        method: 'get'
    })
}

export function getUserData(userId) {
    return request({
        url: '/personal/user?userId=' + userId,
        method: 'get'
    })
}

export function updateUserInfo(data) {
    return request({
        url: '/personal/user/update',
        method: 'post',
        data
    })
}

export function updatePassword(userId, password) {
    return request({
        url: '/personal/user/update/password?userId=' + userId + '&password=' + password,
        method: 'post',
    })
}

export function getCollectData(userId) {
    return request({
        url: '/personal/collect?userId=' + userId,
        method: 'get'
    })
}

export function deleteCollect(categoryId) {
    return request({
        url: '/personal/collect/delete?categoryId=' + categoryId,
        method: 'delete'
    })
}

export function updateCategory(data) {
    return request({
        url: '/personal/collect/update',
        method: 'post',
        data
    })
}